import hashlib
from django.conf import settings


def MD5(password):
    # 加盐
    md5_obj = hashlib.md5(settings.SECRET_KEY.encode('utf-8'))
    md5_obj.update(password.encode('utf-8'))
    return md5_obj.hexdigest()
